// 存放路由逻辑
const fs = require("fs");
module.exports = function (routeEvent) { // 形参
  // 添加事件监听
  routeEvent.on("./index", function (req, res) {
    console.log("出发了index事件");
    let data = fs.readFileSync("./views/index.html");
    res.write(data);
    res.end();
  })

  routeEvent.on("./user", function (req, res) {
    console.log("触发了user事件");
    let data = fs.readFileSync("./views/user.html");
    res.write(data);
    res.end();
  })

  routeEvent.on("./login", function (req, res) {
    console.log("出发了login事件");
    let data = fs.readFileSync("./views/login.html");
    res.write(data);
    res.end();
  })

}